Repository navigation
Conversation
PipeWire cursor metadata carries position and appearance, not buttons. Read pointer buttons from the session input nodes and store the clicks with the cursor events auto zoom already reads.
|
@kyzer1023 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
| match stop_wakeup_rx.recv_timeout(Duration::from_millis(16)) { | ||
| Ok(()) | Err(RecvTimeoutError::Disconnected) => break, | ||
| Err(RecvTimeoutError::Timeout) => continue, |
There was a problem hiding this comment.
If /dev/input is unreadable, every timeout runs continue, so the recorder never reads the PipeWire cursor feed. With custom cursor capture enabled, the portal now supplies video without an embedded pointer. These recordings therefore lose the pointer entirely, not just clicks. After waiting, use an empty click list and still process cursor metadata.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/recording/src/cursor.rs
Line: 754-756
Comment:
**Recordings lose the pointer**
If `/dev/input` is unreadable, every timeout runs `continue`, so the recorder never reads the PipeWire cursor feed. With custom cursor capture enabled, the portal now supplies video without an embedded pointer. These recordings therefore lose the pointer entirely, not just clicks. After waiting, use an empty click list and still process cursor metadata.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in a33db884. When the click source is empty, the tick no longer skips the PipeWire cursor sample after waiting—it records the cursor position with an empty click list. Covered by pipewire_cursor_moves_are_written_without_a_click_source.
| self.kept.extend_from_slice(changes); | ||
| None | ||
| } | ||
| PointerPlace::Hidden | PointerPlace::Outside => None, |
There was a problem hiding this comment.
Dropping Hidden and Outside without writing a move leaves playback at the last visible position. After the pointer leaves a recorded area, the editor keeps drawing it inside that area until another move arrives. Save a visibility change or an off-screen position, and restore the pointer when it returns.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/recording/src/wayland_pointer.rs
Line: 283
Comment:
**Pointer stays after leaving**
Dropping `Hidden` and `Outside` without writing a move leaves playback at the last visible position. After the pointer leaves a recorded area, the editor keeps drawing it inside that area until another move arrives. Save a visibility change or an off-screen position, and restore the pointer when it returns.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in a33db884. Hidden and Outside pointer states now write one off-frame move ((-1, -1) when hidden without coordinates, or the actual out-of-bounds normalized coordinates when outside) and emit the next visible move even if it matches the previous visible point, while continuing to suppress clicks and duplicate hidden/outside moves. Covered by the_pointer_leaves_the_card_and_comes_back.
| if let Ok(entries) = std::fs::read_dir("/dev/input") { | ||
| for entry in entries.flatten() { | ||
| let name = entry.file_name(); | ||
| let Some(name) = name.to_str() else { | ||
| continue; | ||
| }; | ||
| if is_event_node(name) { | ||
| nodes.push(entry.path()); | ||
| } | ||
| } |
There was a problem hiding this comment.
Reconnected mouse clicks vanish
ClickSource scans input devices only at startup. A mouse connected or reconnected during recording is never added, although disconnected readers are removed. This silently loses clicks for the rest of the segment, so later clicks cannot trigger automatic zoom. Watch for new devices or periodically reopen eligible input nodes.
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/recording/src/wayland_pointer.rs
Line: 316-325
Comment:
**Reconnected mouse clicks vanish**
`ClickSource` scans input devices only at startup. A mouse connected or reconnected during recording is never added, although disconnected readers are removed. This silently loses clicks for the rest of the segment, so later clicks cannot trigger automatic zoom. Watch for new devices or periodically reopen eligible input nodes.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Fixed in a33db884. ClickSource now watches /dev/input via inotify and rescans at most once per second (and immediately after a node disconnects), skipping already-open paths and allowing disconnected paths to be re-adopted. Covered by a_reconnected_pointer_is_adopted_once.
An empty /dev/input wait used to skip the PipeWire cursor sample, so a recording with custom cursor capture lost the pointer as well as the clicks. Process that sample every tick. A hidden or out-of-frame pointer now writes one off-frame move, the same kind of coordinate the X11 window recorder stores, and the next visible position brings it back. Pointer nodes that appear after the recording starts are opened on inotify or on a one-second rescan, without reopening nodes that are already held.
Why
On Wayland, PipeWire cursor metadata carries cursor position and appearance, not mouse button presses. As a result, Wayland recordings had empty
clicksincursor.json, so automatic zoom never generated zoom segments for Wayland takes.What changed
crates/recording/src/wayland_pointer.rsto open readable pointer/dev/input/event*nodes on Wayland and emit press/release click events (BTN_LEFT/BTN_RIGHT/BTN_MIDDLE), degrading cleanly when/dev/inputis not readable by the current user.crates/recording/src/sources/screen_capture/linux.rs,crates/recording/src/cursor.rs, andcrates/recording/src/studio_recording.rsso clicks land incursor.jsonin the same format automatic zoom already consumes.crates/recording/src/wayland_pointer.rsandcrates/recording/src/sources/screen_capture/linux/wayland_portal_tests.rs. X11 cursor capture is unchanged.Verification
Verified on a real Sway 1.9 Wayland session (
xdg-desktop-portal-wlr, Linux Mint 22.3, Intel UHD 620 / NVIDIA MX150,cap-gpuirunning as unprivileged userkyzer):cap.logreportedWayland click source opened pointers=1. Becausekyzeris not in theinputgroup on this host, the test used a synthetic uinput pointer (/dev/input/event21) with read ACLuser:kyzer:r--(production users need read access to/dev/input/event*via theinputgroup or udev ACL; otherwise click capture degrades cleanly without failing the recording).Display 1) completed withrecording-meta.jsonstatus: "Complete".ffprobeoncontent/segments/segment-0/display.mp4confirmed playable H.264yuv420p1024×768 video, duration31.358700s,27frames (sparse delivery on nested X11-backed SwayX11-1;xdg-desktop-portal-wlrrefused cursor metadata mode4and retried with embedded cursor, socursor.jsonmovesis empty while clicks still arrive from evdev).cursor.jsoncontained 8 click entries (4 primary press/release pairs,cursor_num: 1) at20.073s,21.820s,23.560s, and25.319s..capin the editor ranauto-zoom-on-open, clearedautoZoomPending, and wrotetimeline.zoomSegments:start: 19.772,end: 27.819,amount: 2.0,mode: "auto"(covering all four clicks).On Ubuntu 22.04.5 x86-64 with headless Sway 1.7 and PipeWire 1.2.7, a synthetic pointer emitted eight press and release pairs while
straceconfirmedEACCESon its device node. At7d4c66842, the recording finalized asComplete, all 235 H.264 frames decoded, andcursor.jsonrecorded zero clicks.

Confidence Score: 5/5
The PR appears safe to merge; all three previous findings are addressed.Summary
Adds Wayland mouse clicks to
cursor.jsonso recordings can generate automatic zoom.All three previous findings are addressed. No new findings were accepted.
Reviews (6) · Last reviewed commit: "chore: retrigger CI after Windows late-m..." · Reviewed by Greptile